# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer:
pkgname=elfio
pkgver=3.12
pkgrel=0
pkgdesc="ELF reader and producer implemented as a header only C++ library"
url="https://github.com/serge1/ELFIO"
arch="noarch"
license="MIT"
makedepends="cmake ninja"
subpackages="$pkgname-dev"
source="https://github.com/serge1/ELFIO/releases/download/Release_$pkgver/elfio-$pkgver.tar.gz
	fix-cmake-install-dir.patch
	page_size.patch
	"
options="!check"  # no tests included in release tarball

build() {
	cmake -G Ninja -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=None
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build

	rm -rf "$pkgdir"/usr/share/docs
}

sha512sums="
13ec6be1f8ee3d7dc96d4ff141d3c199dacd818470c0d902403215571ce3d998afe9e71a8c64e0e69cfb86a4794752d93e2e406025f4812e499e51b67201e23c  elfio-3.12.tar.gz
a913982727ec3a0c35f7701302afded5c9c308d7bd059873b996cbfd69350a11a4c66f72beea0c1ffa1170504e82fb81ea59861122dd2e5d34138d47bd92ef1b  fix-cmake-install-dir.patch
512a47c6a7bd23ad44007a07882fec203782754a11756cde2ed81452bdd8250f8d92c44d3c4d235720c54dc2ee798e38c6e68f9a7597cd406f698c7921d341c6  page_size.patch
"
